package com.inxedu.os.edu.controller.main;

import com.inxedu.os.common.util.Md5Utils;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Component;

@Component
public class MyPasswordEncoder implements PasswordEncoder {
    @Override
    public String encode(CharSequence charSequence) {
        return Md5Utils.stringToMD5(charSequence.toString());

    }

    @Override
    public boolean matches(CharSequence charSequence, String s) {

        return s.equals(encode(charSequence));
}}
